package com.zys.text;

import javax.swing.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

public class text2 {
    public static void main(String[] args) {
        JFrame jFrame = new JFrame();
        //设置界面大小
        jFrame.setSize(603,680);
        //设置界面标题
        jFrame.setTitle("拼图游戏 V1.0");
        //设置界面置顶
        jFrame.setAlwaysOnTop(true);
        //设置界面居中
        jFrame.setLocationRelativeTo(null);

        //设置关闭模式
        jFrame.setDefaultCloseOperation(3);
        //取消默认居中
        jFrame.setLayout(null);


        JButton jbt = new JButton("点我");
        jbt.setBounds(0,0,100,50);


        //jbt.addActionListener(new MyActionListener());
        jbt.addActionListener(new ActionListener(){

            @Override
            public void actionPerformed(ActionEvent e) {
                System.out.println("按钮被点击了");
            }
        });
        jFrame.getContentPane().add(jbt);


        jFrame.setVisible(true);
    }
}
